<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>全部会员页面</title>
<meta name="renderer" content="webkit">	
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
<meta name="apple-mobile-web-app-status-bar-style" content="black">	
<meta name="apple-mobile-web-app-capable" content="yes">	
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/table.css">
</head>
<body>
	<div class="content-head">悦宝园会员管理系统</div>
	<div class="content-main">
		<div class="side-nav" ms-controller="navBar">
			<ul class="nav-item">
				<li><a href="main.html" class="nav-item-front nav-item-add">首页</a></li>
				<li ms-for="el in @navTitleArr">
					<a href="javascript:;" class="nav-item-front">{{el.par}}</a>
					<dl class="nav-item-child">
						<dd ms-for="($index, ex) in el.child"><a ms-attr='{href: el.href[$index]}'>{{ex}}</a></dd>
					</dl>
				</li>
			</ul>
		</div>
		<div class="content bg-gray" ms-controller="main">
			<div class="tab-content">
				<div class="tab-item">
					<div class="sub-main">
						<p class="sub-title"><i>全部会员</i></p>
						<div class="search-area">
							<div class="search-block">
								<span class="search-name">宝宝姓名：</span>
								<div class="search-input"><input type="text" maxlength="20" class="search-in" name="name"></div>
							</div>
							<div class="search-block">
								<a href="javascript:;" class="search-btn" ms-on-click="searchData()">搜索</a>
							</div>
						</div>
						<div class="table-area">
							<div class="table-head">
								<span class="col-15">宝宝姓名</span>
								<span class="col-15">出生日期</span>
								<span class="col-15">剩余课时数</span>
								<span class="col-15">剩余有效期</span>
								<span class="col-20">电话</span>
								<span class="col-20">操作</span>
							</div>
							<div class="table-body">
								<div class="table-line" ms-for="el in @allData">
									<div class="col-padding col-border col-inline col-center col-15">{{el.name}}{{el.nickName ? "("+el.nickName+")" : ""}}</div>
									<div class="col-padding col-border col-inline col-center col-15">{{el.birthday}}</div>
									<div class="col-padding col-border col-inline col-center col-15" ms-html="@subClass(el)"></div>
									<div class="col-padding col-border col-inline col-center col-15">{{el.reClassNum}}</div>
									<div class="col-padding col-border col-inline col-center col-20">{{el.tel}}</div>
									<div class="col-padding col-border col-inline col-center col-20">
										<a href="javascript:;" class="table-editBtn" ms-on-click="editPage(el.flag)" style="margin-right: 10px;">修改</a>
										<a href="javascript:;" class="table-editBtn" ms-on-click="searchPass(el.flag)">销课查询</a>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
<script src="js/jq.js"></script>
<script src="js/avalon.js"></script>
<script src="js/main.js"></script>
<script>
(function() {
	// var freeClassFunc = function(dataObj) {
	// 	var freeObj = dataObj,
	// 		ids = 0;
	// 	if(freeObj) {
	// 		for (var i = 0; i < freeObj.length; i++) {
	// 			ids += parseInt(freeObj[i].free);
	// 		};
	// 		return ids;
	// 	}
	// 	return ids;
	// };

	var vm = avalon.define({
		$id: "main",
		allData: [],
		subClass: function(el) {
			return parseInt(el.classNum.formal) + parseInt(el.classNum.free);
		},
		editPage: function(flag) {
			var status = baseFunc.setSessionData("jumppage", flag);
			if(status) {
				baseFunc.locationSkip("editMember.html");
			}
		},
		searchPass: function(flag) {
			var status = baseFunc.setSessionData("jumppage", flag);
			if(status) {
				baseFunc.locationSkip("passClassSearch.html");
			}
		},
		searchData: function() {
			var val = $(".search-in").val();
			var searchResultName1 = baseFunc.getStorageData("member", {name: val}, "dim");
			var searchResultName2 = baseFunc.getStorageData("member", {nickName: val}, "dim");

			this.allData = searchResultName1.concat(searchResultName2);
		}
	});

	vm.allData = baseFunc.getStorageData("member");
})();
</script>
</body>
</html>